package adapter.impl;

import adapter.MediaPlayer;

public class AudioPlayer implements MediaPlayer {
    MediaAdpter mediaAdpter;

    @Override
    public void play(String audioType, String fileName) {
        if (audioType.equalsIgnoreCase("mp3")) {
            System.out.println("播放内置支持的mp3格式" + fileName);
        } else if (audioType.equalsIgnoreCase("vlc") || audioType.equalsIgnoreCase("mp4")) {
            mediaAdpter = new MediaAdpter(audioType);
            mediaAdpter.play(audioType, fileName);
        } else {
            System.out.println("不支持的文件类型");
        }
    }
}
